package com.zqh.forum.dao;

import com.zqh.forum.model.Message;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);

    /**
     * 根据用户id查询该用户未读的站内信的数量
     * @param receiveUserId 用户id
     * @return 未读数量
     */
    Integer selectUnreadCount(@Param("receiveUserId") Long receiveUserId);

    /**
     *  根据接受者的用户id查询所有的站内信
     * @param receiveUserId 用户id
     * @return
     */
    List<Message> selectByReceiveUserId(@Param("receiveUserId")Long receiveUserId);

}